<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

    <aside  th:fragment="aside" class="tass-scroll">
        <div class="aside-item" th:each="menu:${menuList}">
             <img th:src="${menu.menuLogo}"/>
             <span th:text="${menu.name}"></span>

             <div class="item-one" th:each="option:${menu.menuSecondList}">
                 <a  th:class="${current_user.selectedMenuId}==${option.id}?'item-selected':''"  th:text="${option.name}"  th:onclick="menu_selected([[${option.url}]],[[${option.id}]])">
                     交互错误!
                 </a>
             </div>
        </div>


        <script th:inline="javascript">
            //判断菜单有没有失效
            let menuList= [[${menuList}]];

            if(!menuList){
                window.location.href="/index";
            }

            //菜单被选择
            function menu_selected(url,id){
                let cid = [[${current_user.selectedMenuId}]];

                //如果点击的是当前菜单，不跳转
                if(cid==id){
                    return false;
                }

                window.location.href=url+"&menuId="+id;
            }
        </script>
    </aside>
</html>